<template>
  <div>
    <el-collapse value="common">
      <el-collapse-item title="公共配置" name="common">
        <el-form :model="widget.UI.data" label-width="80px" size="mini" class="pad-lft-rgt-10">
          <el-row :gutter="10">
            <el-col :span="12">
              <el-form-item label="默认底色">
                <PopoverColor :colorValue="widget.UI.data.trackColor">
                  <CustomColorPicker v-model="widget.UI.data.trackColor" show-alpha></CustomColorPicker>
                </PopoverColor>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="选中颜色">
                <PopoverColor :colorValue="widget.UI.data.valueColor">
                  <CustomColorPicker v-model="widget.UI.data.valueColor" show-alpha></CustomColorPicker>
                </PopoverColor>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="总时长(s)">
                <el-input-number
	                v-model="widget.UI.data.seconds"
	                :min="1"
	                controls-position="right"
	                placeholder="请设置总时长"
	                class="width-100">
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="进度方向">
                <el-select v-model="widget.UI.data.forward" placeholder="请选择" class="width-100">
                  <el-option label="正向" :value=true></el-option>
                  <el-option label="逆向" :value=false></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
  import CustomColorPicker from '@/components/IDE/colorPicker/Color.vue';
  import {WidgetProcessor} from "@/modules/IDE/widget/atom/widgetProcessor";
  import PopoverColor from '@/components/IDE/colorPicker/Popovers.vue';

  export default {
    name: 'ProcessorSpec',
    components: {
      CustomColorPicker, PopoverColor
    },
    props: {
      widget: {
        type: WidgetProcessor,
        default: () => {
          return {};
        }
      }
    },
    data() {
      return {
      }
    },
    computed: {
      state() {
        return this.widget.getCurrentState();
      }
    },
  };
</script>

<style scoped></style>
